import React, { useEffect, useState } from 'react'
import { Toast } from 'antd-mobile';
import '@/assets/RegisterDetail/index.less'
function RegisterDetail(props: any) {
  // console.log(props.location.state)//动态路由传递过来的
  let [cinemaname, setcinemaname] = useState(null)
  let [Belongingto, setBelongingto] = useState(null)
  let [size, setsize] = useState(null)
  let [role, setrole] = useState(null)
  let [boxflag, setboxflag] = useState(null)
  let clickAxios = () => {
    if (boxflag !== true) {
      Toast.fail('请同意服务条款之后注册', 1);
    }
    else if (cinemaname == null || Belongingto == null || size == null || role == null) {
      Toast.fail('注册内容不能为空', 1);
    }
    else {
      // console.log(props.location.state,cinemaname,Belongingto,size,role,boxflag)//调用接口需要传递的参数
      // Axios.post(***,{
      //   detailItem,cinemaname,Belongingto,size,role,boxflag
      // })
      //调用接口需要传递的所有参数
    }
  }
  // const {} = props;
  return (
    <div className='RegisterDetail'>
      <div className='RegisterDetail_div_img'>
        <div>
          <div>
            {/* <img src={props.location.state.img} alt=''/> */}
          </div>
          {/* <span>{props.location.state.title}</span> */}
          {/* <span>{props.location.state.tel}</span> */}
        </div>
      </div>
      <div className='RegisterDetail_div_main'>
        <div className='RegisterDetail_div_main_ipt'>
          <p>
            <b>影楼名称</b><input type='text' placeholder='请输入影楼名称' onChange={(e: any) => {
              setcinemaname(cinemaname = e.target.value)
            }} />
          </p>
          <p>
            <b>所属地区</b><input type='text' placeholder='请输入归属地区' onChange={(e: any) => {
              setBelongingto(Belongingto = e.target.value)
            }} />
          </p>
          <p>
            <b>影楼规模</b><input type='text' placeholder='请输入影楼规模' onChange={(e: any) => {
              setsize(size = e.target.value)
            }} />
          </p>
          <p>
            <b>所属角色</b><input type='text' placeholder='请输入所属角色' onChange={(e: any) => {
              setrole(role = e.target.value)
            }} />
          </p>
          <button onClick={() => {
            clickAxios()
          }}>确认注册</button>
        </div>
        <div className='RegisterDetail_div_main_check'>
          <p style={{ marginTop: '20px' }}>
            <input type='checkbox' onChange={(e: any) => {
              setboxflag(boxflag = e.target.checked)
            }} />&nbsp;同意《用户协议》、《产品协议》</p>
        </div>
      </div>
    </div>
  )
}

export default RegisterDetail




